﻿<%@ Page Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="EquipmentTypes.aspx.cs" Inherits="EquipmentTypes" Title="CMMS" %>

<asp:Content ID="Content1" ContentPlaceHolderID="conSearch" Runat="Server">
    &nbsp;
            <div class="AccordionPanel">
        	    <div class="AccordionPanelTab"><b class="contentcolor"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/indicator.png" />Equipment Type</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
        	    <div class="AccordionPanelContent">
        	      <br />
        	      
     <div style="text-align:left; height: 40px;" >
         <asp:Label ID="Label1" runat="server" Text="Equipment type Nº"></asp:Label>
        
&nbsp;<asp:TextBox ID="txtEquipmentTypeId" runat="server" Height="16px" Width="200px" >  
      </asp:TextBox>
         
         <br />
     &nbsp;<br />
         
         <div>
           <asp:Label ID="Label2" runat="server" Text="Equipment type"></asp:Label>
             
&nbsp;<asp:TextBox ID="txtEquipmentTypeLabel" runat="server" Height="16px" Width="200px" >
                 
             </asp:TextBox>
             <br />
             <br />
             <div style="height: 30px" align="right">

                 <asp:Button CssClass="btnexpress" BorderStyle="Dotted" ID="bntSearch" 
                     runat="server" Text="Search" onclick="bntFilter_Click" />
                     &nbsp;&nbsp;&nbsp;
             </div>
         </div>
     </div> 
 </div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="m_contentBody" Runat="Server">

    <body>
    
         <asp:TextBox ID="txtHiddenTypeEquipmentId" runat="server" Width="77px" 
            Visible="False"></asp:TextBox>                          
    <div id="containerright" class="containerright">
          <div id="TabbedPanels1" class="TabbedPanels" >
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">List equipment type</li>
                  <li class="TabbedPanelsTab" tabindex="1">Add equipment type</li>
                  <li class="TabbedPanelsTab" tabindex="2">Equipment type detail </li>
                </ul>
              <div class="TabbedPanelsContentGroup" >

                  <div class="TabbedPanelsContent" >
                   
                
<table  class="GridItem" cellspacing="2" cellpadding="2" style="width:750px;height:350px">

<tr><td align="center" class="BigLabel" >
         <asp:Label ID="lblTotalTypeEquipment" runat="server" Text="Label"></asp:Label>
        </td></tr>
        
 <tr >
             <td  align="center" class="GridItem"  style="text-align:center">
             <asp:GridView ID="grdEquipmentType1" runat="server" AllowPaging="True" Width="750px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                     onselectedindexchanged="grdSystem1_SelectedIndexChanged" 
                     CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="3">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
             </asp:GridView >        
                 <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                     TypeName="DirectService"></asp:ObjectDataSource>
             <br />
             </td>    
         </tr>
                
        
<tr><td align="center" class="GridItem"  style="text-align:left">
<asp:UpdatePanel ID="updatePanelEquipment" runat="server">
            <ContentTemplate>
<div style=" height:350px; width:auto; overflow:auto">
                <asp:GridView ID="grdEquipmentType" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" 
                    CssClass="GridItem" DataSourceID="dsEquipmentType" 
                    OnPageIndexChanging="grdEquipment_PageIndexChanging" 
                    onrowcancelingedit="grdEquipment_RowCancelingEdit" 
                    onrowcommand="grdSystem_RowCommand" onrowdatabound="grdEquipment_RowDataBound1" 
                    onrowdeleting="grdSystem_RowDeleting" onrowediting="grdSystem_RowEditing" 
                    onrowupdated="grdSystem_RowUpdated" onrowupdating="grdSystem_RowUpdating" 
                    onselectedindexchanged="grdEquipment_SelectedIndexChanged" 
                    onsorted="grdSystem_Sorted" PageSize="15" RowHeaderColumn="EquipmentId" 
                    Width="96%" DataKeyNames="TypeEquipementId">
                   
                    <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                    <Columns>
                        <asp:CommandField DeleteText="" InsertText="" ShowEditButton="True" 
                            ShowSelectButton="True">
                            <ItemStyle Width="20px" />
                        </asp:CommandField>
                        <asp:ButtonField CommandName="Delete" Text="Delete">
                            <ItemStyle Width="40px" />
                        </asp:ButtonField>
                        
                       
                      <%--  <asp:ButtonField CommandName="Detail" Text="Detail">
                            <ItemStyle Width="40px" />
                  
                        </asp:ButtonField>--%>
                        
                        <asp:TemplateField >
                            <ItemTemplate >  
                                <a href="EquipmentTypes.aspx?tabIndex=2&equipementTypeId=<%# DataBinder.Eval(Container.DataItem, "TypeEquipementId") %>"  > 
                              <%--  <img border=0 src="./images/edit.png" width="15" height="15">--%>
                                Detail</a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField >
                            <ItemTemplate >  
                                <a href="EquipmentTypes.aspx?tabIndex=1&equipementTypeId=<%# DataBinder.Eval(Container.DataItem, "TypeEquipementId") %>"  > 
                              <%--  <img border=0 src="./images/edit.png" width="15" height="15">--%>
                                New</a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                      
                        
                        <asp:BoundField DataField="TypeEquipementId" HeaderText="Nº" ReadOnly="True" 
                            SortExpression="TypeEquipementId">
                            <ItemStyle Width="50px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Equipment type" SortExpression="TypeEquipment">
                            <ItemTemplate>
                                <%# Eval("TypeEquipment")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                &nbsp;<asp:TextBox ID="textBox0" runat="server" Text='<%# Bind("TypeEquipment") %>' 
                                     Width="95%"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        
                       
                    </Columns>
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
</asp:GridView>
</div>
                 <asp:ObjectDataSource ID="dsEquipmentType" runat="server" 
                    SelectMethod="GetEquipmentTypeDisplayed" TypeName="DirectService" 
                    UpdateMethod="UpdateEquipmentType" onselected="dsEquipmentType_Selected" 
                    >
                     <UpdateParameters>
                         <asp:Parameter Name="TypeEquipementId" Type="Int32" />
                         <asp:Parameter Name="TypeEquipment" Type="String" />
                     </UpdateParameters>
                     <SelectParameters>
                         <asp:ControlParameter ControlID="txtHiddenWhereClause" Name="WhereClause" 
                             PropertyName="Text" Type="String" />
                         <asp:Parameter Name="orderclause" Type="String" />
                     </SelectParameters>
                </asp:ObjectDataSource>
                
    </td></tr>
     
   <tr><td>
    <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="false"></asp:TextBox>
    <a id="detailPosition"></a>
       <asp:TextBox ID="txtHiddenWhereClause" runat="server" Height="17px" Width="205px" Visible="False"></asp:TextBox>
       <asp:TextBox ID="txthiddenOrderbyClause" runat="server"  Width="64px" 
            Visible="False"></asp:TextBox>
              <Triggers>
              
                <asp:AsyncPostBackTrigger ControlID="txtHiddenWhereClause" EventName="TextChanged" />
                
            </Triggers>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="txthiddenOrderbyClause" EventName="TextChanged" />
            </Triggers>
        	    </ContentTemplate>
        	    </asp:UpdatePanel>
     
                   
         </td></tr>         
  </table>
            
             </div>
                  <div class="TabbedPanelsContent" style="width:700px; height:400px">
                       <iframe src="EquipmentTypeAdd.aspx" width="100%" height="400px" frameborder="0" style="border:0px"></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->       
              
                  <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="EquipmentTypeDetail.aspx?&equipementTypeId=<%=GetEquipmentTypeId()%>"  frameborder="0" ></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->
                    
                    
           </div>      
    </div>
 
 </body>
 
 <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    
 </script>
   
</asp:Content>
